package com.example.cache_demo.controller;

import com.example.cache_demo.entity.ResultBean;
import com.example.cache_demo.entity.TestResultBean;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
@RequestMapping
public class TestController {

    @GetMapping("/getUserData")
    public String delete(Long code){
        System.out.println("获取的code是："+code);

        String json = "{\n" +
                "\t\"code\": 200, " +
                "\t\"message\": \"请求成功\", " +
                "\t\"data\": {\n" +
                "\t\t\"id\": 123456," +
                "\t\t\"name\": \"客户\"," +
                "\t\t\"gender\": 1," +
                "\t\t\"age\": 18 " +
                "\n" +
                "\t}\n" +
                "}";
        return json;
    }


    @PostMapping("/postTestdata")
    public String delete(ResultBean bean){
        System.out.println("获取的对象是："+bean);

        String json = "{\n" +
                "\t\"code\": 200, " +
                "\t\"message\": \"请求成功\", " +
                "\t\"data\": {\n" +
                "\t}\n" +
                "}";
        return json;
    }

    /**
     * 上传扫码的数据
     * @param cardNo
     * @return
     */
    @GetMapping("/code")
    public String getCode(String cardNo){
        System.out.println("获取的code是："+cardNo);

        String json = "{\n" +
                "\"data\":[\n" +
                "{\n" +
                "\"addr\":\"哈哈哈!\",\n" +
                "\"addrId\":\"b770cc890011836c23fc\",\n" +
                "\"age\":\"21岁\",\n" +
                "\"archiveNo\":\"211214133602423_2\",\n" +
                "\"birthday\":\"2000-12-14 00:00:00\",\n" +
                "\"deptId\":\"\",\n" +
                "\"deptName\":\"\",\n" +
                "\"doctorId\":\"\",\n" +
                "\"doctorName\":\"\",\n" +
                "\"erhCardId\":\"\",\n" +
                "\"erhCardNo\":\"\",\n" +
                "\"erhCardPfId\":\"\",\n" +
                "\"gender\":\"1\",\n" +
                "\"gjhdqDm\":\"\",\n" +
                "\"id\":\"b770cb7d000e836c23fc\",\n" +
                "\"idCardId\":\"b770cc86000f836c23fc\",\n" +
                "\"idCardNo\":\"654325200012149473\",\n" +
                "\"identId\":\"b770ccef0012836c23fc\",\n" +
                "\"identyNo\":\"00000789456\",\n" +
                "\"identyType\":\"X1\",\n" +
                "\"isVisit\":\"\",\n" +
                "\"name\":\"测试电话号码\",\n" +
                "\"nativeAddrId\":\"\",\n" +
                "\"opcDate\":null,\n" +
                "\"opcId\":\"\",\n" +
                "\"orgId\":\"\",\n" +
                "\"patientType\":\"普通病人\",\n" +
                "\"patientTypeColor\":\"\",\n" +
                "\"patientTypeId\":\"1\",\n" +
                "\"personIdentList\":null,\n" +
                "\"remark\":\"\",\n" +
                "\"sgrsfDm\":\"11\",\n" +
                "\"shyzkDm\":\"\",\n" +
                "\"smzDm\":\"01\",\n" +
                "\"swhcdDm\":\"\",\n" +
                "\"teleId\":\"b770cc880010836c23fc\",\n" +
                "\"teleNo\":\"1369852472\",\n" +
                "\"workOrganization\":\"\"\n" +
                "}\n" +
                "],\n" +
                "\"message\":\"查询成功\",\n" +
                "\"result\":\"1\"\n" +
                "}";
        return json;
    }

    /**
     * 测出结果上传的数据
     * @param bean
     * @return
     */
    @PostMapping("/upLoadUser")
    public String upLoadUser(TestResultBean bean){
        System.out.println("获取的对象是："+bean);

        String json = "{\n" +
                "\"message\":\"查询成功\",\n" +
                "\"result\":\"1\"\n" +
                "}";
        return json;
    }

}
